<!DOCTYPE html>
<html lang="utf-8">
<head>
    <meta charset="UTF-8">
    <#include "/comm/module-index.ftl"/>
</head>
<body>
<div class="layui-div-body">
    <div class="layui-fluid  layui-div-table">
        <div>
            <form class="layui-form searchForm" autocomplete="off">
                <div class="layui-inline layui-show-xs-block layui-input-wrap" style="width: 400px">
                    <input class="layui-input" autocomplete="off" placeholder="包名"
                           name="packageName" lay-verify="required" value="com.manager.gen.module">
                </div>
                <div class="layui-inline layui-show-xs-block layui-input-wrap" style="width: 400px">
                    <input class="layui-input" autocomplete="off" placeholder="分组名"
                           name="groupName">
                </div>
                <div class="layui-inline layui-show-xs-block">
                    <button class="layui-btn  layui-btn-sm" lay-submit="" lay-filter="generator"><i
                                class="layui-icon  layui-icon-add-1"></i>生成
                    </button>
                </div>
            </form>
        </div>
        <#-- table-->
        <div class="layui-table-body" style="flex: 1;margin-top: 20px;" id="layui-table-bar">
            <table class="layui-hide" lay-filter="layui-table-main" id="layui-table-main"></table>
        </div>
    </div>
</div>

<#--<#include "/comm/lay-extend-index.ftl"/>-->
<script type="text/javascript">
    layui.use(['index'], function () {
        let tableBase = layui.index,form = layui.form;
        tableBase.render({
            noPage: true,
            cols: [{
                type: 'checkbox',
                fixed: 'left',
                align: 'center'
            },
                {type: 'space', hide: true, field: "_id"},
                {type: 'numbers', fixed: 'left'},
                {field: 'talbeName', title: '表名'},
                {field: 'columnComment', title: '注释'},
            ]
        })
        // 搜索提交
        form.on('submit(generator)', function (data) {
            var field = data.field; // 获得表单字段
            var ids = tableBase.checkTableId()
            if (ids) {
                field['_ids'] = ids;
                post('${request.contextPath}/platform/generator/save', field);
            } else {
                layer.msg('请勾选操作项!', {icon: 0});
            }

            return false; // 阻止默认 form 跳转
        });
    });

</script>
</body>
</html>